package cn.com.nes.site.controller.project;

import cn.com.nes.common.web.CommonResult;
import cn.com.nes.site.entity.vo.project.SelectBusinessOpportunityAndSaveCustomerVO;
import cn.com.nes.site.service.project.ProjectWorkOrderDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Api(tags = {"项目模块-项目管理"})
@Controller
@RequestMapping("/v2/project/workOrderData")
public class ProjectWorkOrderDataController {

    @Resource
    private ProjectWorkOrderDataService projectWorkOrderDataService;

    @ApiOperation(value = "选择商机保存客户功能", notes = "选择商机保存客户功能，可批量添加")
    @RequestMapping(value = "/selectBusinessOpportunityAndSaveCustomer", method = RequestMethod.POST)
    public @ResponseBody CommonResult<?> selectBusinessOpportunityAndSaveCustomer(
            @RequestBody @Validated SelectBusinessOpportunityAndSaveCustomerVO vo) throws Exception {
        projectWorkOrderDataService.selectBusinessOpportunityAndSaveCustomer(vo);
        return CommonResult.ok("操作成功");
    }

}
